home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / PInterfaces / ImageCodec.p < prev    next >
Encoding:
Text File  |  1995-07-06  |  7.3 KB  |  245 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ImageCodec.p
  3.  
  4.      Contains:    QuickTime Interfaces.
  5.  
  6.      Version:    Technology:    QuickTime 2.0
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT ImageCodec;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __IMAGECODEC__}
  30. {$SETC __IMAGECODEC__ := 1}
  31.  
  32. {$I+}
  33. {$SETC ImageCodecIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __QUICKDRAW__}
  43. {$I Quickdraw.p}
  44. {$ENDC}
  45. {    MixedMode.p                                                    }
  46. {    QuickdrawText.p                                                }
  47.  
  48. {$IFC UNDEFINED __QDOFFSCREEN__}
  49. {$I QDOffscreen.p}
  50. {$ENDC}
  51. {    Errors.p                                                    }
  52.  
  53. {$IFC UNDEFINED __WINDOWS__}
  54. {$I Windows.p}
  55. {$ENDC}
  56. {    Memory.p                                                    }
  57. {    Events.p                                                    }
  58. {        OSUtils.p                                                }
  59. {    Controls.p                                                    }
  60. {        Menus.p                                                    }
  61.  
  62. {$IFC UNDEFINED __IMAGECOMPRESSION__}
  63. {$I ImageCompression.p}
  64. {$ENDC}
  65. {    Components.p                                                }
  66. {    StandardFile.p                                                }
  67. {        Dialogs.p                                                }
  68. {            TextEdit.p                                            }
  69. {        Files.p                                                    }
  70. {            Finder.p                                            }
  71.  
  72. {$IFC UNDEFINED __COMPONENTS__}
  73. {$I Components.p}
  74. {$ENDC}
  75.  
  76. {$IFC UNDEFINED __MOVIES__}
  77. {$I Movies.p}
  78. {$ENDC}
  79. {    Aliases.p                                                    }
  80. {        AppleTalk.p                                                }
  81.  
  82. {$PUSH}
  83. {$ALIGN MAC68K}
  84. {$LibExport+}
  85.  
  86. CONST
  87.     codecGetCodecInfo            = $00;
  88.     codecGetCompressionTime        = $01;
  89.     codecGetMaxCompressionSize    = $02;
  90.     codecPreCompress            = $03;
  91.     codecBandCompress            = $04;
  92.     codecPreDecompress            = $05;
  93.     codecBandDecompress            = $06;
  94.     codecCDSequenceBusy            = $07;
  95.     codecGetCompressedImageSize    = $08;
  96.     codecGetSimilarity            = $09;
  97.     codecTrimImage                = $0A;
  98.     codecRequestSettings        = $0B;
  99.     codecGetSettings            = $0C;
  100.     codecSetSettings            = $0D;
  101.     codecCDSequenceFlush        = $0E;
  102.     codecSetTimeCode            = $0F;
  103.  
  104.     codecCanScale                = 1 * (2**(0));
  105.     codecCanMask                = 1 * (2**(1));
  106.     codecCanMatte                = 1 * (2**(2));
  107.     codecCanTransform            = 1 * (2**(3));
  108.     codecCanTransferMode        = 1 * (2**(4));
  109.     codecCanCopyPrev            = 1 * (2**(5));
  110.     codecCanSpool                = 1 * (2**(6));
  111.     codecCanClipVertical        = 1 * (2**(7));
  112.     codecCanClipRectangular        = 1 * (2**(8));
  113.     codecCanRemapColor            = 1 * (2**(9));
  114.     codecCanFastDither            = 1 * (2**(10));
  115.     codecCanSrcExtract            = 1 * (2**(11));
  116.     codecCanCopyPrevComp        = 1 * (2**(12));
  117.     codecCanAsync                = 1 * (2**(13));
  118.     codecCanMakeMask            = 1 * (2**(14));
  119.     codecCanShift                = 1 * (2**(15));
  120.     codecCanAsyncWhen            = 1 * (2**(16));
  121.     codecCanShieldCursor        = 1 * (2**(17));
  122.     codecCanManagePrevBuffer    = 1 * (2**(18));
  123.  
  124.  
  125. TYPE
  126.     CodecCapabilities = RECORD
  127.         flags:                    LONGINT;
  128.         wantedPixelSize:        INTEGER;
  129.         extendWidth:            INTEGER;
  130.         extendHeight:            INTEGER;
  131.         bandMin:                INTEGER;
  132.         bandInc:                INTEGER;
  133.         pad:                    INTEGER;
  134.         time:                    LONGINT;
  135.     END;
  136.  
  137.  
  138. CONST
  139.     codecConditionFirstBand        = 1 * (2**(0));
  140.     codecConditionLastBand        = 1 * (2**(1));
  141.     codecConditionFirstFrame    = 1 * (2**(2));
  142.     codecConditionNewDepth        = 1 * (2**(3));
  143.     codecConditionNewTransform    = 1 * (2**(4));
  144.     codecConditionNewSrcRect    = 1 * (2**(5));
  145.     codecConditionNewMask        = 1 * (2**(6));
  146.     codecConditionNewMatte        = 1 * (2**(7));
  147.     codecConditionNewTransferMode = 1 * (2**(8));
  148.     codecConditionNewClut        = 1 * (2**(9));
  149.     codecConditionNewAccuracy    = 1 * (2**(10));
  150.     codecConditionNewDestination = 1 * (2**(11));
  151.     codecConditionFirstScreen    = 1 * (2**(12));
  152.     codecConditionDoCursor        = 1 * (2**(13));
  153.     codecConditionCatchUpDiff    = 1 * (2**(14));
  154.     codecConditionCodecChangedMask = 1 * (2**(31));
  155.  
  156.     codecInfoResourceType        = 'cdci';
  157.     codecInterfaceVersion        = 2;
  158.  
  159.  
  160. TYPE
  161.     CodecCompressParams = RECORD
  162.         sequenceID:                ImageSequence;
  163.         imageDescription:        ImageDescriptionHandle;
  164.         data:                    Ptr;
  165.         bufferSize:                LONGINT;
  166.         frameNumber:            LONGINT;
  167.         startLine:                LONGINT;
  168.         stopLine:                LONGINT;
  169.         conditionFlags:            LONGINT;
  170.         callerFlags:            CodecFlags;
  171.         capabilities:            ^CodecCapabilities;
  172.         progressProcRecord:        ICMProgressProcRecord;
  173.         completionProcRecord:    ICMCompletionProcRecord;
  174.         flushProcRecord:        ICMFlushProcRecord;
  175.         srcPixMap:                PixMap;
  176.         prevPixMap:                PixMap;
  177.         spatialQuality:            CodecQ;
  178.         temporalQuality:        CodecQ;
  179.         similarity:                Fixed;
  180.         dataRateParams:            DataRateParamsPtr;
  181.         reserved:                LONGINT;
  182.     END;
  183.  
  184.     CodecDecompressParams = RECORD
  185.         sequenceID:                ImageSequence;
  186.         imageDescription:        ImageDescriptionHandle;
  187.         data:                    Ptr;
  188.         bufferSize:                LONGINT;
  189.         frameNumber:            LONGINT;
  190.         startLine:                LONGINT;
  191.         stopLine:                LONGINT;
  192.         conditionFlags:            LONGINT;
  193.         callerFlags:            CodecFlags;
  194.         capabilities:            ^CodecCapabilities;
  195.         progressProcRecord:        ICMProgressProcRecord;
  196.         completionProcRecord:    ICMCompletionProcRecord;
  197.         dataProcRecord:            ICMDataProcRecord;
  198.         port:                    CGrafPtr;
  199.         dstPixMap:                PixMap;
  200.         maskBits:                BitMapPtr;
  201.         mattePixMap:            PixMapPtr;
  202.         srcRect:                Rect;
  203.         matrix:                    ^MatrixRecord;
  204.         accuracy:                CodecQ;
  205.         transferMode:            INTEGER;
  206.         frameTime:                ICMFrameTimePtr;
  207.         reserved:                ARRAY [0..0] OF LONGINT;
  208.         matrixFlags:            SInt8;
  209.         matrixType:                SInt8;
  210.         dstRect:                Rect;
  211.     END;
  212.  
  213.  
  214. CONST
  215.     matrixFlagScale2x            = 1 * (2**(7));
  216.  
  217.  
  218. FUNCTION CDGetCodecInfo(storage: Handle; VAR info: CodecInfo): ComponentResult;
  219. FUNCTION CDGetCompressionTime(storage: Handle; src: PixMapHandle; {CONST}VAR srcRect: Rect; depth: INTEGER; VAR spatialQuality: CodecQ; VAR temporalQuality: CodecQ; VAR time: LONGINT): ComponentResult;
  220. FUNCTION CDGetMaxCompressionSize(storage: Handle; src: PixMapHandle; {CONST}VAR srcRect: Rect; depth: INTEGER; quality: CodecQ; VAR size: LONGINT): ComponentResult;
  221. FUNCTION CDPreCompress(storage: Handle; VAR params: CodecCompressParams): ComponentResult;
  222. FUNCTION CDBandCompress(storage: Handle; VAR params: CodecCompressParams): ComponentResult;
  223. FUNCTION CDPreDecompress(storage: Handle; VAR params: CodecDecompressParams): ComponentResult;
  224. FUNCTION CDBandDecompress(storage: Handle; VAR params: CodecDecompressParams): ComponentResult;
  225. FUNCTION CDCodecBusy(storage: Handle; seq: ImageSequence): ComponentResult;
  226. FUNCTION CDGetCompressedImageSize(storage: Handle; desc: ImageDescriptionHandle; data: Ptr; bufferSize: LONGINT; dataProc: ICMDataProcRecordPtr; VAR dataSize: LONGINT): ComponentResult;
  227. FUNCTION CDGetSimilarity(storage: Handle; src: PixMapHandle; {CONST}VAR srcRect: Rect; desc: ImageDescriptionHandle; data: Ptr; VAR similarity: Fixed): ComponentResult;
  228. FUNCTION CDTrimImage(storage: Handle; Desc: ImageDescriptionHandle; inData: Ptr; inBufferSize: LONGINT; dataProc: ICMDataProcRecordPtr; outData: Ptr; outBufferSize: LONGINT; flushProc: ICMFlushProcRecordPtr; VAR trimRect: Rect; progressProc: ICMProgressProcRecordPtr): ComponentResult;
  229. FUNCTION CDRequestSettings(storage: Handle; settings: Handle; VAR rp: Rect; filterProc: ModalFilterUPP): ComponentResult;
  230. FUNCTION CDGetSettings(storage: Handle; settings: Handle): ComponentResult;
  231. FUNCTION CDSetSettings(storage: Handle; settings: Handle): ComponentResult;
  232. FUNCTION CDCodecFlush(storage: Handle): ComponentResult;
  233. FUNCTION CDCodecSetTimeCode(storage: Handle; timeCodeFormat: UNIV Ptr; timeCodeTime: UNIV Ptr): ComponentResult;
  234.  
  235. {$ALIGN RESET}
  236. {$POP}
  237.  
  238. {$SETC UsingIncludes := ImageCodecIncludes}
  239.  
  240. {$ENDC} {__IMAGECODEC__}
  241.  
  242. {$IFC NOT UsingIncludes}
  243.  END.
  244. {$ENDC}
  245.